const { searchUser, addFriend, setRemark } = require("./modules/addFriend")
const { createGroupChat } = require("./modules/createGroup")
const { modifyLike, modifyNickname } = require("./modules/myInfo")
const { deleteDynamicImageFile, releaseDynamic } = require("./modules/editDynamics")
const { sendMessage, getApplications, sendFriendList, signup, login, getGroupChats, connectToGroupChats, delFriend, updateFriendGroup } = require("./modules/login")
const { handleFriendRequest } = require("./modules/newFriend")
const { getDynamic, handleLike_dynamic, handleSend_comment_dynamic } = require("./modules/userInfo")
const { getGroupNotifications, handleGroupInvitation, createGroupInvitation, checkUnreadGroupNotifications } = require("./modules/groupNotification")
const { getGroupMembers, updateGroupAnnouncement, renameGroup, quitGroup, dismissGroup, inviteGroupMembers } = require("./modules/groupManagement")

const event = [
    {   // 登录
        name : 'login',
        fn   : login
    },
    {   // 注册
        name : 'signup',
        fn   : signup
    },
    {   // 发送信息
        name : 'send_message',
        fn   : sendMessage
    },
    {   // 获取好友
        name : 'get_friend',
        fn   : sendFriendList
    },
    {   // 点赞
        name : 'modify_like',
        fn   : modifyLike
    },
    {   // 删除【动态】图片文件
        name : 'delete_dynamicImageFile',
        fn   : deleteDynamicImageFile
    },
    {   // 发布【动态】
        name : 'release_dynamic',
        fn   : releaseDynamic
    },
    {   // 搜索用户
        name : 'search_user',
        fn   : searchUser
    },
    {   // 添加好友
        name : "add_friend",
        fn   : addFriend
    },
    {   // 确认好友请求
        name : "handle_friendRequest",
        fn   : handleFriendRequest
    },
    {   // 获取好友请求
        name : "get_applications",
        fn   : getApplications
    },
    {   // 创建群聊
        name : "create_groupChat",
        fn   : createGroupChat
    },
    {   // 获取群聊
        name : "get_groupChats",
        fn   : getGroupChats
    },
    {   // 连接到群聊
        name: "connect_to_groupChats",
        fn  : connectToGroupChats
    },
    {   // 获取用户【动态】
        name: "get_dynamic",
        fn  : getDynamic
    },
    {   // 处理【动态】被其他人点赞
        name: "like_dynamic",
        fn  : handleLike_dynamic
    },
    {   // 处理【动态】被其他人评论
        name: "sent_comment",
        fn  : handleSend_comment_dynamic
    },
    {   // 修改昵称
        name: "modify_nickname",
        fn  : modifyNickname
    },
    {   // 删除指定好友
        name: "del_friend",
        fn  : delFriend
    },
    {   // 设置好友备注
        name: "set_remark",
        fn  : setRemark
    },
    {   // 更新好友分组
        name: "update_friend_group",
        fn  : updateFriendGroup
    },
    {   // 获取群通知
        name: "get_group_notifications",
        fn  : getGroupNotifications
    },
    {   // 处理群邀请
        name: "handle_group_invitation",
        fn  : handleGroupInvitation
    },
    {   // 创建群邀请
        name: "create_group_invitation",
        fn  : createGroupInvitation
    },
    {   // 检查未读群通知
        name: "check_unread_group_notifications",
        fn  : checkUnreadGroupNotifications
    },
    {   // 获取群成员
        name: "get_group_members",
        fn  : getGroupMembers
    },
    {   // 更新群公告
        name: "update_group_announcement",
        fn  : updateGroupAnnouncement
    },
    {   // 重命名群聊
        name: "rename_group",
        fn  : renameGroup
    },
    {   // 退出群聊
        name: "quit_group",
        fn  : quitGroup
    },
    {   // 解散群聊
        name: "dismiss_group",
        fn  : dismissGroup
    },
    {   // 邀请群成员
        name: "invite_group_members",
        fn  : inviteGroupMembers
    }
]

module.exports = event;